package siyuan.run.sentinel.related;

import com.alibaba.csp.sentinel.Tracer;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: sy
 * @description:
 * @author: SY
 * @create: 2020-12-18 13:00
 **/
@RestController
public class RelatedController {

    @GetMapping("exception")
    public String exception(){
        try {
            throw new RuntimeException("throw RuntimeException");
        }catch (Throwable throwable){
            Tracer.trace(throwable);
        }
        return "测试异常比例降级";
    }

}
